unit uERP_DmAparencia;

interface

uses
  SysUtils, Classes, ImgList, Controls, dxSkinsCore,
  dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
  dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle, Forms,
  dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast,
  dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky,
  dxSkinMcSkin, dxSkinMoneyTwins, dxSkinOffice2007Black, dxSkinOffice2007Blue,
  dxSkinOffice2007Green, dxSkinOffice2007Pink, dxSkinOffice2007Silver,
  dxSkinOffice2010Black, dxSkinOffice2010Blue, dxSkinOffice2010Silver,
  dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
  dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
  dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010,
  dxSkinWhiteprint, dxSkinXmas2008Blue, cxLookAndFeels, cxLocalization,
  Graphics, cxGraphics, dxSkinsForm, dxSkinMetropolis, dxSkinMetropolisDark,
  dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray, dxSkinOffice2013White,
  cxClasses, cxDropDownEdit, NasajonSkin, NasajonSkinDestaque;

type
  TDmAparencia = class(TDataModule)

    {$REGION '<< Components >>'}

      lfGridGrupo: TcxLookAndFeelController;
      cxLocalizer: TcxLocalizer;
      imgBarraHabilitada: TcxImageList;
      ImageListAtivo: TcxImageList;
      imglstStatusBar: TcxImageList;
      dxSkinController: TdxSkinController;

    {$ENDREGION}

    {$REGION '<< Events >>'}

      procedure DataModuleCreate(Sender: TObject);
    procedure dxSkinControllerSkinForm(Sender: TObject; AForm: TCustomForm;
      var ASkinName: string; var UseSkin: Boolean);

    {$ENDREGION}

    {$REGION '<< Public >>'}

      public

        {$REGION '<< Methods >>'}

          procedure Load(const a_Combo: TcxComboBoxProperties);
          procedure SetSkin(const a_Skin: String);

        {$ENDREGION}

    {$ENDREGION}

  end;

var dmAparencia: TDmAparencia;

implementation

{ %CLASSGROUP 'Vcl.Controls.TControl' }

{$R *.dfm}

uses IniFiles, uERP_Enumerados;

{$REGION '<< TDmAparencia >>'}

procedure TDmAparencia.DataModuleCreate(Sender: TObject);
begin
  lfGridGrupo.NativeStyle := False;
  dxSkinController.NativeStyle := False;
end;

procedure TDmAparencia.dxSkinControllerSkinForm(Sender: TObject; AForm: TCustomForm; var ASkinName: string; var UseSkin: Boolean);
begin
  ASkinName := 'McSkin';
end;

procedure TDmAparencia.Load(const a_Combo: TcxComboBoxProperties);
var
  Indice: eSkinsDisponiveis;
begin
  a_Combo.BeginUpdate;
  try
    a_Combo.Items.Clear;
    for Indice := Low(eSkinsDisponiveis) to High(eSkinsDisponiveis)
      do a_Combo.Items.Add(cSkinsDisponiveisDisplay[Indice]);
  finally
    a_Combo.EndUpdate;
  end;
end;

procedure TDmAparencia.SetSkin(const a_Skin: String);
var
  t_indice: eSkinsDisponiveis;
begin
  for t_Indice := Low(eSkinsDisponiveis) to High(eSkinsDisponiveis) do
    begin
      if cSkinsDisponiveisDisplay[t_Indice] = a_Skin
        then Break;
    end;
  Self.lfGridGrupo.SkinName := cSkinsDisponiveisDefault[t_Indice];
end;

{$ENDREGION}

end.
